package com.sywl.service.impl;

import java.util.List;
import java.util.Map;

import javax.persistence.TableGenerator;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sywl.dao.DeptDao;
import com.sywl.orm.Dept;
import com.sywl.service.DeptService;
import com.sywl.util.DataGridModel;

@Service
public class DeptServiceImpl implements DeptService {

	@Autowired
	private DeptDao dao;
	
	@Transactional
	public void addDept(Dept dept) {
		dao.addDept(dept);
	}
	
	@Transactional
	public void updateDept(Dept dept) {
		dao.updateDept(dept);
	}

	@Transactional
	public Map<String, Object> getPageList(DataGridModel dgm, Dept dept)
			throws Exception {
		return dao.getPageList(dgm, dept);
	}

	@Transactional
	public Dept findById(Integer deptId) {
		return dao.findById(deptId);
	}

	@Transactional
	public void delDept(Integer deptId) {
		dao.delDept(deptId);
	}

	@Transactional
	public List<Dept> listDept() {
		return dao.listDept();
	}
}
